package com.jianganming.strategy.promotion;

import java.util.HashMap;
import java.util.Map;

public class PromotionStrategyFactory {
    private static Map<StrategyEnum,IPromotionStrategy> promotionStrategyMap = new HashMap<>();

    static {
        promotionStrategyMap.put(StrategyEnum.Empty,new EmptyStrategy());
        promotionStrategyMap.put(StrategyEnum.Groupbuy,new GroupbuyStrategy());
        promotionStrategyMap.put(StrategyEnum.Cashback,new CashbackStrategy());
        promotionStrategyMap.put(StrategyEnum.Coupon,new CouponStrategy());
    }

    public static IPromotionStrategy getPromotionStrategy(StrategyEnum strategyEnum){
        IPromotionStrategy iPromotionStrategy = promotionStrategyMap.get(strategyEnum);
        return iPromotionStrategy;
    }




}
